<template>
  <div class="schedule">
      <div id='schedule-box' class="boxshaw"></div>
  </div>
</template>
<script>
    import Schedule from '*/js/plugins/schedule'
    import Utils from '*/js/modules/utils'
    export default{
        data(){
            return{
                date:''
            }
        },
        components:{

        },
        mounted(){
            let me=this;
            this.$nextTick(function () {
                var mySchedule = new Schedule({
                    el: '#schedule-box',
                    //date: '2018-9-20',
                    clickCb: function (y,m,d) {
                        me.date=y+'-'+Utils.formatNumber(m)+'-'+Utils.formatNumber(d)
                        me.passDate(me.date);
                    },
                    nextMonthCb: function (y,m,d) {
                        me.date=y+'-'+Utils.formatNumber(m)+'-'+Utils.formatNumber(d)
                        me.passDate(me.date);
                    },
                    nextYeayCb: function (y,m,d) {
                        me.date=y+'-'+Utils.formatNumber(m)+'-'+Utils.formatNumber(d)
                        me.passDate(me.date);
                    },
                    prevMonthCb: function (y,m,d) {
                        me.date=y+'-'+Utils.formatNumber(m)+'-'+Utils.formatNumber(d)
                        me.passDate(me.date);
                    },
                    prevYearCb: function (y,m,d) {
                        me.date=y+'-'+Utils.formatNumber(m)+'-'+Utils.formatNumber(d)
                        me.passDate(me.date);
                    }
                });
            });
        },
        methods:{
            passDate:function(param){
                this.$emit('getDate',param);
            }
        }
    }
</script>
<style>
    @import '../../static/css/schedule.css';
    @import '//at.alicdn.com/t/font_422064_p8r7hzac5oskyb9.css';
</style>

